Dan Winship [Wed, 24 Mar 2010 17:27:21 +0000 (13:27 -0400)]
Fix dragging of App Well and Places icons
The hover rewrite added a freeze/thaw_notify to
st_clickable_leave_event() (to match the one already in
st_clickable_enter_event()), which broke code in two places that
assumed "pressed" would still be TRUE when "hover" changed to FALSE.
Fix that by exposing the "held" property as well.
Adel Gadllah [Wed, 24 Mar 2010 16:34:30 +0000 (17:34 +0100)]
Fix build on x86_64
A pointer does not equal to an int on x86_64
(which results into pointer - pointer not being an int either),
fix that by casting the resulting value to an int.
Dan Winship [Mon, 15 Mar 2010 16:20:10 +0000 (12:20 -0400)]
[MessageTray] Use #StWidget:track-hover
St.Widget's new "hover" property takes reactive children into account
when deciding whether or not the pointer has actually left the actor,
so it works better than the code that used to be here.
Dan Winship [Fri, 19 Mar 2010 17:47:34 +0000 (13:47 -0400)]
[StWidget] add (optional) hover tracking
If track-hover is set, update the hover property automatically, and
the "hover" pseudo class to match, as StClickable used to do. (Remove
the corresponding code in StClickable). Tweak the tooltip handling to
use track-hover, which also makes it slightly more reliable in the
presence of reactive children, etc.
Dan Winship [Fri, 19 Mar 2010 15:37:04 +0000 (11:37 -0400)]
[StWidget] add list-like methods for style_class and pseudo_class
Since style_class and pseudo_class are space-separated lists of names,
add new methods to add and remove individual names rather than just
re-setting the entire name.
Update existing code to use the new pseudo-class methods where
appropriate. In some cases, this may result in actors having multiple
pseudoclasses where previously they only had one at a time, but there
don't seem to be any visible differences.
(There are some places that could usefully use the new style_class
methods as well, but this patch doesn't change them.)
Also, update test-theme.c to test the new methods.
Adel Gadllah [Tue, 23 Mar 2010 19:22:46 +0000 (20:22 +0100)]
[runDialog] Don't add duplicates to the history
When the user runs the same command as the last one saved there
is no need to save it again, otherwise we the history might end
up having lots of dupes which makes searching for an old command
harder.
Owen W. Taylor [Fri, 19 Mar 2010 20:46:08 +0000 (16:46 -0400)]
[workspaces] Don't use a clone for the window drag actor
Using a clone for the drag actor causes the animation into
the final position not to work as expected; instead use
the newly added DND parameters to change the original
drag actors size and opacity. (This reverts the change in 011db9f).
Since we are using the original actor, we have to be careful
not to change it during the drag, so don't actually position
dragged window actors in Workspace.positionWindows().
Florian Müllner [Fri, 19 Mar 2010 11:13:31 +0000 (12:13 +0100)]
Remove user_data arguments for callbacks
Gjs now removes user_data arguments for callbacks - the existing
code still works because all user_data arguments are unused and
at the end of the argument list, but it's a lot prettier to remove
them.
Florian Müllner [Sun, 14 Feb 2010 23:32:57 +0000 (00:32 +0100)]
Don't destroy and recreate workspaces on view switches
Currently, the workspace objects are destroyed and recreated on
view switches. Instead, keep the objects around and reparent the
workspace actors on view switches.
Florian Müllner [Tue, 23 Feb 2010 04:44:09 +0000 (05:44 +0100)]
[Overview] Switch workspace when dragging the desktop
Depending on screen size and pointer position, the scroll bar used
to switch the active workspace in linear view may not be a convenient
target, so allow dragging the desktop as an alternative.
Florian Müllner [Tue, 23 Feb 2010 13:25:09 +0000 (14:25 +0100)]
[placeDisplay] Fix dnd regression
DND from the places section broke with 1c4c3afb when St.Label was
replaced with St.Button.
To fix, replace St.Button with St.Clickable and use a fake_release
when starting a drag.
Now that we don't use pure black for the overview background
there is less incentive to soften or differentiate the top
bar using a gradient. Without a gradient it blends better
with screen bezels and reinforces the idea of being negative space.
Florian Müllner [Wed, 10 Mar 2010 14:25:08 +0000 (15:25 +0100)]
[placeDisplay] Show a message when unmount fails
When an unmount operation fails, the only feedback given currently
is an exception on stderr. Use the infoBar to display an error
message and allow the user to retry the operation.
Florian Müllner [Wed, 10 Mar 2010 14:14:56 +0000 (15:14 +0100)]
[InfoBar] Allow to optionally change the button label
Currently the infoBar's button will always read "Undo" - sometimes
a different label makes more sense, so allow to optionally set the
label to something else.
Adel Gadllah [Wed, 17 Mar 2010 17:31:03 +0000 (18:31 +0100)]
Prevent from being partly offscreen
Limit the AppSwitcher to the screen size by either downscaling or
scrolling.
We scale the icons down up from 96, 64, 48, 32 to 22 and start scrolling
if we still fail to fit on screen.
The thumbnail box is shifted to either left or right, when failing to
fit we scroll here to.
To prevent from being offscreen at the buttom we adjust the thumbnail
height to fit.
The old positioning logic is replaced with a ShellGenericContainer to
implement a custom allocation system.
Florian Müllner [Sun, 14 Mar 2010 14:47:42 +0000 (15:47 +0100)]
[Workspace] Disconnect reposition handler when leaving overview
As the repositioning after closing a window preview is delayed, it is
possible that the timeout is triggered while leaving the overview. In
that case the previews move to the new overview position and are changed
abruptly to the original window position when the overview zoom is done.
To prevent this, disconnect the handler when leaving the overview.
Florian Müllner [Fri, 12 Feb 2010 20:12:39 +0000 (21:12 +0100)]
Move workspace controls into a single object
Rename WorkspacesViewSwitch to WorkspacesControls and let it manage
all workspace controls. Do not destroy and recreate the controls bar
actor on each view change, but add it to the overview once and let it
update itself.
Colin Walters [Tue, 9 Mar 2010 22:31:06 +0000 (17:31 -0500)]
Shrink windows to small previews when dragging
Hide the original actor during a grab, and create a new
clone. This is easier than trying to ensure we maintain
the state of the original window clone.
Colin Walters [Fri, 12 Mar 2010 20:57:01 +0000 (15:57 -0500)]
Fix app icon fading
The way we were loading data into a CoglTexture, then pulling it out
and manipulating it on the CPU, then loading it back into a texture
was a bit lame.
Clean things up a bit here by loading directly into the CPU, doing
the fading, then creating a texture.
Dan Winship [Tue, 2 Mar 2010 18:51:00 +0000 (13:51 -0500)]
Error out at startup if the GConf schemas are missing
If we don't do this, then boolean/int/list keys will seem to sort of
work (but defaulting to false/0/[] instead of the correct schema
defaults), but string keys will return null, which will usually cause
exceptions or crashes.
Owen W. Taylor [Wed, 10 Mar 2010 23:32:10 +0000 (18:32 -0500)]
Simplify handling of adjustments
The relationship between adjustments and scrollbars and
scrollable widgets was much more complex than it needed to be.
StScrollView: Have the scroll view own a pair of adjustments,
set them on the child on add(), remove unnecessary
change notification signal connections.
StBoxLayout: Remove auto-create of adjustments, just take the
adjustments from the scrollbars and set them on the scrollable
child. Notify for hadjustment/vadjustment properties.
StScrollBar: Notify adjustment property.
StScrollable: Document how adjustment setting works.
Owen W. Taylor [Wed, 10 Mar 2010 23:22:06 +0000 (18:22 -0500)]
Fixes for dispose and finalize
* Add missing chain-up for dispose and finalize methods
* ShellGenericContainer needs to destroy its children in dispose()
* Fix variable naming and excess casts in st_label_dispose()
Owen W. Taylor [Wed, 10 Mar 2010 18:57:05 +0000 (13:57 -0500)]
Fixes for setting up scrolling adjustments
StScrollable: Document how to set adjustments
StBoxLayout: Make sure that we always have upper >= lower + page_size,
so that clamping works properly. Set the page_increment to be slightly
less than the page_size so there is some overlap, as is customary.
StScrollView: Remove unnecessary fabs() calls, rewrite expressions
for additional clarity.
Owen W. Taylor [Wed, 10 Mar 2010 16:56:04 +0000 (11:56 -0500)]
Incremental fixes for scrollview work
- Fix existing typos and spacing problems
- Get preferred height, not current height, of shadows
- Let shadows overflow don't clamp them when we have too little space
- Remove a now-unecessary stray MAX()
- Fix up scrollview visibility for the pathological case of no child
- Disconnect from adjustments on remove()
- Don't unset the adjustments on the child on remove(), since they
already existed or were autocreated on add()
(We should what we are doing and set the adjustments of the
scrollbars on the child rather than setting the adjustments of
the child, so we match GTK+'s scrolllable interface, but this
at least makes it consistent instead of a weird mix.)
Owen W. Taylor [Fri, 5 Mar 2010 22:20:56 +0000 (17:20 -0500)]
Fix size negotiation for StScrollView
StScrollable: Document how size negotation now works between the
parent and scrollable child.
StBoxLayout: Adapt to the new contract for how size negotiation
works; in particular, handle being allocated less than the
minimum size when scrolled and treat the minimum size as the
size of the scrolled area in instead of the natural size.
StScrollView: Substantially rewrite with fixes including:
- Implement new size negotation contract; this allows us
to determine scrollbar visibility without having to
connect to the adjustment.
- Implement all ALWAYS along with the existing NEVER/AUTO
- When hiding and showing scrollbars and shadows, don't
hide and show widgets, just turn on and off including them
in pick and paint. This avoids queueing relayouts.
- Cleanups for the code for connecting to adjustments,
for changing policy, and for turning on and off shadows.
scroll-view-sizing.js: New test case for StScrollView, allowing
resizing the scroll view interactively, changing the scrollbar
policies and turning shadows on and off.
Owen W. Taylor [Fri, 5 Mar 2010 21:17:07 +0000 (16:17 -0500)]
[StScrollBar] avoid queueing a relayout during allocation
When an StScrollView is allocated, allocating the child would
cause the adjustment values to change, which would result in
the scrollbars queueing a relayout, which isn't allowed during
allocation.
To avoid this, instead of queueing a relayout when the adjustment
changes:
- When we have a valid allocation already, just go ahead
and reallocate the children.
- Otherwise do nothing immediately and wait until we get allocated
Because the 'needs_allocation' flag in ClutterActor isn't exposed,
this requires some slightly ugly code to shadow that state locally.
Owen W. Taylor [Wed, 3 Mar 2010 23:00:05 +0000 (18:00 -0500)]
Rework StDrawingArea not to use ClutterCairoTexture
Having StDrawingArea use ClutterCairoTexture causes circularity
problems with sizing - StDrawingArea wants to use its allocation for
the size of the texture, but ClutterTexture wants to use the size of
the texture to determine the requited size.
Avoid this by making StDrawingArea directly use Cairo and CoglTexture;
while doing this, the API is changed a bit for simplicity and to
match our use case:
- Instead of clutter_cairo_texture_create(), we have
st_drawing_area_get_context() to retrieve an already created
context. This can only be called in the ::repaint signal.
- The ::redraw signal is changed to ::repaint so we can have
st_drawing_area_queue_repaint() that doesn't collide with
clutter_actor_queue_redraw()
- ::repaint is now emitted lazily when painting the actor rather
than synchronously at various different points.
Owen W. Taylor [Thu, 11 Feb 2010 20:24:13 +0000 (15:24 -0500)]
Support and require Clutter 1.2
- Specify a minimum version of clutter-1.2.0
- Switch clutter branch in the moduleset to master
- Replace deprecated cogl_texture/material_unref() with
cogl_handle_unref()
- Use cogl_clip_push_rectangle() rather than cogl_clip_push()
- Replace cogl_check_extension() with strstr - should be
accurate enough.
Dan Winship [Wed, 17 Feb 2010 20:21:51 +0000 (15:21 -0500)]
st_widget_get_theme_node: g_error if called on an unparented widget
It's wrong to do anything that requires looking up a widget's style
before you add the widget to the stage, since its final style may
depend on properties inherited from its parents.
st_widget_get_theme_node() used to emit a warning in this case, but
many would-be contributors apparently didn't notice. Help them out.
Adel Gadllah [Sun, 7 Mar 2010 18:33:58 +0000 (19:33 +0100)]
Don't activate workspace when more than one window is open
Currently clicking on an empty spot on the workspace actors switches to the workspace, this has a side effect that when for some reason (like using a touchpad),
the user misses the window he intends to open he will end up with the currently focused window instead.
Disable this behaviour if more than one window is open (in that case the user has to explicitly target a specific window).
Florian Müllner [Fri, 26 Feb 2010 19:07:44 +0000 (20:07 +0100)]
[runDialog] Support opening files and folders
Support completion on files and folders in the run dialog and launch
the default application when activated. Assume a path relative to the
home directory if execution as command fails and the input doesn't start
with a slash.
Removed workaround for relayout of error messages.
Maxim Ermilov [Mon, 8 Mar 2010 22:50:49 +0000 (01:50 +0300)]
Look at current mouse position for dropping
Previously we used the top-left corner which was not intuitive,
particularly when dragging partially opaque actors.
https://bugzilla.gnome.org/show_bug.cgi?id=607821